﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Wilson/MP/Base.Master" AutoEventWireup="true" CodeBehind="ProList.aspx.cs" Inherits="WebsiteAdmin.Wilson.ProInfo.ProList" %>
<%@ Register Src="~/Wilson/UC/Pagination.ascx"  TagName="Pagination" TagPrefix="PaginationUC"%>
<asp:Content ID="Content1" ContentPlaceHolderID="Head_Title" runat="server">产品列表 - 产品</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Head_Meta" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Head_Css" runat="server">
    <style type="text/css">
        span.del{ color:#999; text-decoration:line-through;}
        img.thumbImg{ width:40px; height:40px;}
    </style>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Head_Script" runat="server">
    <script type="text/javascript" src="/Script/Mootools.Smoothbox.js"></script>
    <script type="text/javascript" language="javascript">
        var MenuViewID = 2;
        function Del(e, t) {
            if (confirm('确定删除 “' + t + '”？')) {
                //LightBox.show();
                new Request.JSON({
                    method: 'post',
                    url: 'Handler/ProDelete.ashx',
                    data: {
                        PKID: e
                    },
                    noCache: true,
                    onSuccess: function(data, text) {
                        if (data.Done == 'Success') {
                            alert(t + ' 删除成功');
                            document.location.reload();
                        } else {
                            alert(t + ' 删除失败');
                        }
                        //LightBox.remove();
                    },
                    onFailure: function(xhr) {
                        alert(xhr.statusText);
                        LightBox.remove();
                    }
                }).send();
            }
        }
				 window.addEvent('domready', function() {
    if ($('pagego')) {
            
            $('pagego').addEvent('click', function() {
                var no = $('pageno').get('value').trim();
                document.location.href = '?Page=' + no;
            });
        }

    });
    </script>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="Body_Top" runat="server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="Body_Content" runat="server">
    <div class="infobox">
        <h3>
        <span>产品列表</span>
			<a href="/Wilson/ProInfo/ProCreate.aspx" class="add action">新建产品</a>
        </h3>
         <div class="pd05">
            <table border="0" cellpadding="0" cellspacing="1" id="tablegrid" class="tb">
			    <tr>
				    <th width="40">&nbsp;</th>
				    <th width="100">分类</th>
				    <th width="60">图片</th>
				    <th>产品名称</th>		
				    <th width="40">推荐</th>		    
				    <th width="40">排序</th>
				    <th width="40">附图</th>
				    <th width="80" colspan="2">操作</th>
			    </tr>
			    <tbody>
			    <asp:Repeater ID="RP_Product" EnableViewState="False" runat="server" OnItemDataBound="RP_Product_ItemDataBound">
					<ItemTemplate>
				        <td><%#Eval("PKID") %></td>
				        <td><%#Eval("CatName") %></td>
				        <td><asp:Image ID="ThumbURL" runat="server" EnableViewState="false" CssClass="thumbImg"/></td>
				        <td><%#Eval("ProName") %></td>    
				        <td><asp:Label ID="lblRecomm" runat="server" EnableViewState="false"></asp:Label></td>
				        <td><%#Eval("SortBy") %></td>
				        <td><a href="/Wilson/ProInfo/ProOtherImgList.aspx?proId=<%#Eval("PKID") %>">查看</a></td>
				        <td><a href="/Wilson/ProInfo/ProEdit.aspx?pkid=<%#Eval("PKID")%>">修改</a></td>
				        <td><a href="javascript:void(0);" onclick="javascript:Del(<%#Eval("PKID")%>,'<%#Eval("ProName")%>');">删除</a></td>
			        </tr>
			        </ItemTemplate>
				</asp:Repeater>
			    
			    
			    </tbody>
            </table>
            <PaginationUC:Pagination id="Pagination" runat="server" />
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="Body_Foot" runat="server">
</asp:Content>
